package com.healthbox.appointmentservice.mapper;

import com.healthbox.appointmentservice.entity.AppointmentLimit;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.context.annotation.Primary;

import java.time.LocalDate;
import java.util.List;

/**
 * @author pengpeng
 * @date 2022/5/11
 */
@Mapper
@Primary
public interface AppointmentLimitMapper {
    int save(AppointmentLimit limit);

    AppointmentLimit findOneById(Long aLId);

    /**
     * 更新记录时不会判断hospital id是否存在，需要在调用此方法前通过业务做判断
     * @param limit
     * @return
     */
    int update(AppointmentLimit limit);

    Integer exists(String phone, Long aLId);

    int delete(Long aLId);

    List<AppointmentLimit> findByDateAndHospitalId(LocalDate startDate, LocalDate endDate, Long hospitalId, Integer pageSize, Integer index);

    int numberOfAppointment(Long aLId);

    /**
     * 危险：这个方法这是用来测试时使用，不要对外暴露，要不就真要跑路了。
     */
    void truncate();
}
